<% fields_for_username username do |username_form| %>
  <tr class="username_row">
    <td><%= username_form.text_field :username %></td>
    <td><%= username_form.collection_select :authentication_type_id, AuthenticationType.all, :id, :name, {}, {} %></td>    
    <td><%= link_to_function "Remove", "this.up('.username_row').remove()" %></td>
  </tr>
<% end %>